-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Export types from all packages #3326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Build successful! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing jumps out at me as wrong, I see the backwards-compat one for the TimePicker/TimeField.
I'm assuming nothing changed in the @types because that's all already public, and what we want to export already is.
Build successful! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one question about the naming convention
export type {GridProps, GridAria} from './useGrid'; | ||
export type {GridCellAria, GridCellProps} from './useGridCell'; | ||
export type {GridRowGroupAria} from './useGridRowGroup'; | ||
export type {GridRowProps, GridRowAria} from './useGridRow'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that the aria component hook options now follow "AriaCOMPONENTOptions" or "AriaCOMPONENTProps". At the risk of being overly pedantic, should the grid hook props follow this same convention?
Just trying to clarify the naming convention for the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes ideally, but, I couldn't change some of them that were already exported...
I think the convention is:
- Aria___Props if it's props. Most of these come from
@react-types
- Aria___Options if we extended the props to add additional options only for the hook (e.g. additional refs)
- ___Aria for the return types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, GridProps were already exported, I'm fine keeping the other grid props naming in line with that then. Thanks for the clarification
The old OverlayProps was no longer available. This is presumably the result of adobe/react-spectrum#3326.
The old OverlayProps was no longer available. This is presumably the result of adobe/react-spectrum#3326.
The old OverlayProps was no longer available. This is presumably the result of adobe/react-spectrum#3326.
The old OverlayProps was no longer available. This is presumably the result of adobe/react-spectrum#3326.
The old OverlayProps was no longer available. This is presumably the result of adobe/react-spectrum#3326.
The old OverlayProps was no longer available. This is presumably the result of adobe/react-spectrum#3326.
The old OverlayProps was no longer available. This is presumably the result of adobe/react-spectrum#3326.
The old OverlayProps was no longer available. This is presumably the result of adobe/react-spectrum#3326.
Closes #3240. Closes #3087.
We were inconsistent about which types were exported from React Aria and React Stately packages. Mostly it was just if we needed it elsewhere, then it was exported. In addition, developers often needed to install
@react-types
packages in addition to the code packages to get the corresponding type definitions, leading to annoyance.This ensures that all types that are the inputs or outputs of hooks or components (e.g. prop and state objects) are exported. In addition, it re-exports types that come from
@react-types
packages in the corresponding@react-stately
,@react-aria
, and@react-spectrum
packages. Finally, it re-exports all public types from the corresponding mono packages. This means developers usually only need to install one package to get both the code and types they need.Where they were not already exported (and therefore public API), and the naming was inconsistent, I also tried to address this before they become public. We will need to be more mindful of naming conventions for types going forward.
This was mostly automated using a script, but with manual review of all changes.